package org.wlw.map;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class TestMap {
	public static void main(String[] args) {
		Map<String, Integer> maps = new HashMap<>();
		maps.put("abc", 12);
		maps.put("bcd", 22);
		maps.put("ddd", 333);
		
		System.out.println(maps.containsKey("abc"));
		System.out.println(maps.containsValue(22));
		maps.put("abc", 1991);
		maps.remove("abc");
		Set<String> keys = maps.keySet();//keySet会把maps中的key存储到Set中
		for(String key:keys) {
			System.out.println(key+":"+maps.get(key));
		}
	}
}
